package com.ay.shardingshere.mapper;

import com.ay.shardingshere.entity.Order;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Author: ay
 * @Date: 2021/6/24
 * @Description:
 **/
@Mapper
@Component
public interface OrderMapper {

    /**
     * 保存订单列表
     * @param order
     */
    @Insert("insert into t_order(order_id,user_id,address) value (#{userId},#{address})")
    void save(Order order);

    /**
     * 查询订单列表
     * @return
     */
    @Select("select * from t_order")
    List<Order> list();
}
